'''
author:mzy
time:17:29
date:2022/8/26
'''
import json

from dubbo_test.common.basic_services import Basicservices
class MemberService(Basicservices):
    def __init__(self):
        super().__init__()
        self.service_name = "MemberService"

    #调用MemberService服务的findByTelephone方法
    def find_by_telephone(self,telephone):
        resp = self.dubbo_client.invoke(self.service_name,"findByTelephone",telephone)
        # print(resp)
        if resp != "":
            return "yes"
        else:
            return "no"

    #调用MemberService服务的findByTelephone方法
    def add(self,info):
        info["class"] = "com.itheima.pojo.Member"
        resp = self.dubbo_client.invoke(self.service_name,"add",info)
        # print(resp)

    #调用MemberService服务的findMemberCountByMonths方法
    def find_MemberCount_By_Months(self,Months):
        resp = self.dubbo_client.invoke(self.service_name,"findMemberCountByMonths",Months)
        # print(resp)